popover: Hide/ungrab on button release
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 28 Jan 2014 13:05:08 +0000 (14:05 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 28 Jan 2014 15:18:53 +0000 (16:18 +0100)
commit7b4ef9932038a31961517669367d043d71a8acf5
tree68e56db8d8d6dbb3e34d977e2d847255722dfd64
parent3fa9846399fd223041dcfd188d1685d442149d59
popover: Hide/ungrab on button release

If the grab is released during button press, the button release is
just then sent to the widget below the pointer. Depending on the
widget implementation, this could already trigger actions if the
widget does not perform any kind of button state tracking. It is
safer to ungrab on button release so no extra actions are possibly
triggered, and the behavior is uniform across widgets.

But the opposite situation may also happen, that a popover is
shown/grabbed on a button press event, so it'd get the sole button
release event after being shown, so prepare for that case by making
popover ignore single button release events with no preceding button
press.

Fixes issues seen in
https://bugzilla.gnome.org/show_bug.cgi?id=723031#c2
gtk/gtkpopover.c